import 'package:json_annotation/json_annotation.dart';

part 'identify_bank_card.g.dart';

@JsonSerializable()
class IdentifyBankCard extends Object {
  @JsonKey(name: 'log_id')
  int logId;

  @JsonKey(name: 'result')
  Result result;

  IdentifyBankCard(
    this.logId,
    this.result,
  );

  factory IdentifyBankCard.fromJson(Map<String, dynamic> srcJson) => _$IdentifyBankCardFromJson(srcJson);

  Map<String, dynamic> toJson() => _$IdentifyBankCardToJson(this);
}

@JsonSerializable()
class Result extends Object {
  @JsonKey(name: 'bank_card_number')
  String bankCardNumber;

  @JsonKey(name: 'valid_date')
  String validDate;

  @JsonKey(name: 'bank_card_type')
  int bankCardType;

  @JsonKey(name: 'bank_name')
  String bankName;

  Result(
    this.bankCardNumber,
    this.validDate,
    this.bankCardType,
    this.bankName,
  );

  factory Result.fromJson(Map<String, dynamic> srcJson) => _$ResultFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ResultToJson(this);
}
